<template>
  <div class="error-page">
    <div class="error-code">404</div>
    <div class="error-desc">啊哦~ 页面找不到了</div>
    <div class="actions">
      <el-button type="primary" @click="goHome">返回首页</el-button>
      <el-button @click="goBack">返回上一页</el-button>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'

// 定义组件名
defineOptions({
  name: 'NotFoundPage'
})

const router = useRouter()

const goHome = () => {
  router.push('/')
}

const goBack = () => {
  router.go(-1)
}
</script>

<style scoped>
.error-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #f0f2f5;
}

.error-code {
  font-size: 180px;
  font-weight: bold;
  color: #1890ff;
  margin-bottom: 20px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.error-desc {
  font-size: 24px;
  color: #555;
  margin-bottom: 30px;
}

.actions {
  display: flex;
  gap: 15px;
}
</style>
